<template>
    <div>
        <h3>{{$store.state.n}}</h3>
        <h3>{{$store.getters.count}}</h3>
        <button @click="add">按钮</button>
    </div>
</template>

<script>
export default {
    name: 'VueDemoIndex',

    data() {
        return {
            
        };
    },
    methods:{
        add(){
            this.$store.dispatch("add")
        }
    }
};
</script>

<style lang="scss" scoped>

</style>